package com.ztgf.order.mapper;

import com.baomidou.mybatisplus.plugins.Page;
import com.ztgf.order.models.bo.OrderShopStatisticsBO;
import com.ztgf.order.models.bo.OrderStatisticsBO;
import com.ztgf.order.models.vo.OrderSalesCategoryNewVO;
import com.ztgf.order.models.vo.OrderSalesCategoryShopVO;
import com.ztgf.order.models.vo.OrderSalesCategoryVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * author: chenyu.wang
 * date: 2020-07-22 15:49
 * Description: 订单销量统计映射
 */
@Mapper
public interface OrderSalesStatisticsMapper {

    /**
     * description: 查询订单今日销售总额
     * param: [bo]
     * author: chenyu.wang
     * date: 2020-07-22
     * return: java.math.BigDecimal
     */
    BigDecimal queryOrderSalesToDay(@Param("item") OrderStatisticsBO bo);

    /**
     * description: 查询订单销售总额
     * param: [bo]
     * author: chenyu.wang
     * date: 2020-07-22
     * return: java.math.BigDecimal
     */
    BigDecimal queryOrderDealCount(@Param("item") OrderStatisticsBO bo);

    /**
     * description:各类目整体销售额统计
     * param: [categoryId, bo]
     * author: chenyu.wang
     * date: 2020-07-22
     * return: java.math.BigDecimal
     */
    BigDecimal queryOrderSalesCategory(@Param("categoryId") Long categoryId, @Param("item") OrderStatisticsBO bo);

    /**
     * description: 查询所有最终级类目
     * param: []
     * author: chenyu.wang
     * date: 2020-07-22
     * return: java.util.List<com.ztgf.order.models.vo.OrderSalesCategoryVO>
     */
    List<OrderSalesCategoryVO> queryAllFianlCategorySales(Page<OrderSalesCategoryVO> page);

    /**
     * description: 查询店铺类目
     * param: [page]
     * author: chenyu.wang
     * date: 2020-07-22
     * return: java.util.List<com.ztgf.order.models.vo.OrderVariousShopItemsVO>
     */
    List<OrderSalesCategoryShopVO> querySalesShopCategory( @Param("item") OrderShopStatisticsBO bo);

    List<OrderSalesCategoryShopVO> querySalesShopCategory1( @Param("item") OrderShopStatisticsBO bo);

    /**
     * description: 各类目店铺销售额统计
     * param: [shopId, categoryId, bo]
     * author: chenyu.wang
     * date: 2020-07-22
     * return: java.lang.Integer
     */
    BigDecimal queryOrderSalesShopItems(@Param("shopId") Long shopId, @Param("categoryId") Long categoryId, @Param("item") OrderShopStatisticsBO bo);

    /**
     * @Description: 新的各类目订单销量统计，有的类目才显示
     * @Author: chenyu.wang
     * @Params: [page, bo]
     * @Date: 2020.12.27 22:29
     */
    List<OrderSalesCategoryNewVO> queryNewOrderSalesCount(Page<OrderSalesCategoryNewVO> page, @Param("item") OrderStatisticsBO bo);

    List<OrderSalesCategoryShopVO> queryOrderMoney( @Param("item")OrderShopStatisticsBO bo);
}
